package com.ngu.biz.notepad.controller;

import com.ngu.biz.notepad.model.Notepads;
import com.ngu.biz.notepad.services.NotepadsService;
import com.ngu.util.AjaxResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
* @Description:    记事本控制层
* @Author:         hq
* @CreateDate:     2020/2/7
* @Version:        1.0
*/
@RestController
@RequestMapping("/notepads")
public class NotepadsController {

@Autowired
private NotepadsService notepadsService;

    /**
    * @Description:    记事本数据查询
    * @Author:         hq
    * @CreateDate:     2020/2/7
    */
    @RequestMapping("/selectNotepadsList")
    public AjaxResponse selectNotepadsList(Notepads notepads){
        return  notepadsService.selectNotepadsList(notepads);
    }

    /**
    * @Description:    新增记事本
    * @Author:         hq
    * @CreateDate:     2020/2/7
    */
    @RequestMapping("/addNotepads")
    public AjaxResponse addNotepads(Notepads notepads){
        return  notepadsService.addNotepads(notepads);
    }

    /**
     * @Description:    修改记事本
     * @Author:         hq
     * @CreateDate:     2020/2/7
     */
    @RequestMapping("/updateNotepads")
    public AjaxResponse updateNotepads(Notepads notepads){
        return  notepadsService.updateNotepads(notepads);
    }

    /**
     * @Description:    删除记事本
     * @Author:         hq
     * @CreateDate:     2020/2/7
     */
    @RequestMapping("/deleteNotepadsById")
    public AjaxResponse deleteNotepadsById(Notepads notepads){
        return  notepadsService.deleteNotepadsById(notepads);
    }

    /**
     * @Description:    删除多条记事本
     * @Author:         hq
     * @CreateDate:     2020/2/7
     */
    @RequestMapping("/deleteNotepadsByIds")
    public AjaxResponse deleteNotepadsByIds(@RequestParam("nIds") String nIds){
        return  notepadsService.deleteNotepadsByIds(nIds);
    }






}
